Why does indexOf return -1 for a nested array in JavaScript